package com.example.api.controller;


import com.example.api.common.core.CommonResult;
import com.example.api.entity.Question;
import com.example.api.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/questions")
public class QuestionController {

    @Autowired
    private QuestionService questionService;

    // 获取所有问题
    @GetMapping
    public CommonResult getQuestions(){
        List<Question> finQuestions = questionService.list();
        return CommonResult.success(finQuestions);
    }
}